import 'dart:convert';

import 'package:enterprise_v6_app/app/data/entities/application/role_personnel_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/process_nodes_entity.g.dart';

export 'package:enterprise_v6_app/generated/json/process_nodes_entity.g.dart';

///流程节点
@JsonSerializable()
class ProcessNodesEntity {
  ProcessNodesEntity();

  factory ProcessNodesEntity.fromJson(Map<String, dynamic> json) => $ProcessNodesEntityFromJson(json);

  ///	app路由地址
  String? appRoutingAddress = '';

  ///	子控制类型 1-是 2-否
  int? childrenControlType = 0;

  ///	创建人
  String? createBy = '';
  ///  approvalResult 1通过 2驳回，
  String? approvalResult = '';

  /// 创建时间
  String? createDate = '';

  ///	表单id
  String? formId = '';

  /// 图标地址
  String? iconAddress = '';

  ///	主键id
  String? id = '';

  ///	节点描述
  String? nodeDescription = '';

  ///	节点id
  String? nodeId = '';

  ///	节点名称
  String? nodeName = '';

  ///	节点序号
  String? nodeNumber = '';

  ///	节点类型 1：表单节点 2：审批节点 3：开始节点 4：结束节点
  int? nodeType = 0;

  ///	父控制类型 1-并 2-或
  int? parentControlType = 0;

  ///	父级id
  String? pid = '';

  ///	流程唯一编码
  String? processEncoding = '';

  ///	修改人
  String? updateBy = '';

  ///	修改时间
  String? updateDate = '';

  // ///	用户id
  // String? userIds = '';
  /// 节点执行人
  List<RolePersonnelEntity>? userIds = [];

  ///	节点人员等同[userIds]
  List<RolePersonnelEntity>? rtUserProcesses = [];

  ///	前端路由地址
  String? webRoutingAddress = '';

  /// 开始时是否可以更改执行人
  bool? startingCanChanged = true;

  /// 驳回节点id
  String? rejectNodeId = '';

  // /// 执行人姓名
  // String? userName = '';

  /// 人员类型名称
  String? userTypeName = '';

  /// 当前节点是否可执行 1：可以执行 2：不可执行 3：执行通过
  int? executableOrNot = 0;

  /// 运行时模板id
  String? rtemplateId = '';

  /// 封闭化-签名地址
  String? signatureAddress = '';

  /// 封闭化-审核意见
  String? reviewComments = '';

  ///	执行人名称
  String? executorBy = '';

  ///	执行人id
  String? executorById = '';

  ///	执行时间
  String? executorDate = '';

  Map<String, dynamic> toJson() => $ProcessNodesEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
